//
//  TTMusicDiscoveryModel.m
//  TTMusic
//
//  Created by chenpengyu on 16/3/30.
//  Copyright © 2016年 cpy. All rights reserved.
//

#import "TTMusicDiscoveryModel.h"
#import "TTMusicDataModel.h"

@implementation TTMusicDiscoveryModel

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"id"]) {
        self.ID = value;
    }
    if ([key isEqualToString:@"action"]) {
        _action = value;
    }
}
- (instancetype)initWithDataSource:(NSDictionary *)dataSource {
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dataSource];
        NSMutableArray *mutable = [NSMutableArray array];
        for (NSDictionary *dic in self.data) {
            TTMusicDataModel *actionModel = [[TTMusicDataModel alloc] init];
            [actionModel setValuesForKeysWithDictionary:dic];
            [mutable addObject:actionModel];
        }
        self.data = [NSMutableArray arrayWithArray:mutable];
    }
    return self;
}

@end
